<template>
  <div class="orderReplenishment">
    <el-card class="box-card">
      <div slot="header" class="clearfix">
        <span style="line-height: 36px;">订单驱动补货</span>
        <el-button style="float: right;" type="primary" @click="dialogOpen()">新增</el-button>
      </div>
      <s-table
        :table="table"
        :expand="false"
        @http="tableWatch">
        <el-form-item slot="multiSelect" label="多选操作" prop="multiSelect" v-if="table.multiSelect">
          <el-row>
            <el-col :span="8">
              <el-button size="small" type="danger" @click="tableDelete('')">多选删除</el-button>
            </el-col>
            <el-col :span="8">
              <el-button size="small"  type="info" @click="tableConfirm('')">确认收货</el-button>
            </el-col>
            <el-col :span="8">
              <el-button size="small" type="info" @click="tableExport('')">多选导出</el-button>
            </el-col>
          </el-row>
        </el-form-item>
        <el-form-item label="状态" prop="zt">
          <el-select v-model="autoVue_table_zt"
                     placeholder="补货单状态">
            <el-option
              label="全部"
              value=""></el-option>
            <el-option
              v-for="item in ORDERREPLENISHMENT.zt"
              :key="item.dictionaryid"
              :label="item.value"
              :value="item.dictionaryid">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="创建时间" prop="cjsj">
          <el-date-picker
            v-model="autoVue_table_cjsj"
            type="daterange"
            placeholder="选择日期范围">
          </el-date-picker>
        </el-form-item>
        <el-table-column
          fixed="right"
          align="center"
          slot="operation"
          class-name="operationMore"
          label="可用操作"
          width="180">
          <template slot-scope="s">
            <el-button type="info" size="mini" icon="search" @click="dialogSearchOpen(s.row)"></el-button>
            <!--<el-button type="info" size="mini" @click="tablePrint(s.row)"><i class="fa fa-print" aria-hidden="true"></i> 打印</el-button>-->
            <el-tooltip placement="top" v-if="s.row.zt !==2">
              <div slot="content">更多可用操作</div>
              <el-popover
                popper-class="demo-table-expand"
                placement="right"
                title="更多可用操作"
                trigger="click">
                <slot name="content">
                  <el-button type="info" size="mini" @click="dialogIssuedOpen(s.row)" v-if="s.row.zt === 0 && s.row.sczt=== 0">下发补货任务</el-button>
                  <el-button type="info" size="mini" @click="dialogReplenishmentOpen(s.row)" v-if="s.row.zt!=2">查看补货任务</el-button>
                  <!--<el-button type="info" size="mini" @click="tableConfirm(s.row)" v-if="s.row.zt === 0 && s.row.sczt === 0">确认补货单</el-button>-->
                  <el-button type="danger" icon="delete" size="mini" @click="tableDelete(s.row)" v-if="s.row.zt ===0 && s.row.sczt ===0"></el-button>
                </slot>
                <el-button slot="reference" type="info" icon="more" :plain="true" size="mini" class="__reference"></el-button>
              </el-popover>
            </el-tooltip>
          </template>
        </el-table-column>
      </s-table>
    </el-card>
    <s-dialog :dialog="dialog" :close="dialogInit">
      <p slot="title">{{dialog.title}}补货单</p>
      <s-table
        :table="tableAdd" ref="tableAdd"  :multiSelect="true"  @http="tableWatch">
        <el-form-item label="地址" prop="khdz">
          <el-input type="text"
                    class="input"
                    v-model="autoVue_tableAdd_khdz"
                    placeholder="地址" spellcheck="false" auto-capitalize="off" auto-complete="off"
                    auto-correct="off"></el-input>
        </el-form-item>
        <el-form-item label="联系人" prop="lxrxm">
          <el-input type="text"
                    class="input"
                    v-model="autoVue_tableAdd_lxrxm"
                    placeholder="联系人" spellcheck="false" auto-capitalize="off" auto-complete="off"
                    auto-correct="off"></el-input>
        </el-form-item>
        <el-form-item label="波次编号" prop="bcbh">
          <el-input type="text"
                    class="input"
                    v-model="autoVue_tableAdd_bcbh"
                    placeholder="波次编号" spellcheck="false" auto-capitalize="off" auto-complete="off"
                    auto-correct="off"></el-input>
        </el-form-item>
        <el-form-item label="客户名称" prop="khmc">
          <el-input type="text"
                    class="input"
                    v-model="autoVue_tableAdd_khmc"
                    placeholder="客户名称" spellcheck="false" auto-capitalize="off" auto-complete="off"
                    auto-correct="off"></el-input>
        </el-form-item>
        <el-form-item label="发运单号" prop="fybh">
          <el-input type="text"
                    class="input"
                    v-model="autoVue_tableAdd_fybh"
                    placeholder="发运单号" spellcheck="false" auto-capitalize="off" auto-complete="off"
                    auto-correct="off"></el-input>
        </el-form-item>
      </s-table>
      <el-button slot="footer" type="success"  @click="dialogSave">保存</el-button>
    </s-dialog>
    <s-dialog :dialog="dialogSearch" :close="dialogSearchInit">
      <p slot="title">{{dialogSearch.title}}补货单</p>
      <s-table :table="tableSearch" ref="tableSearch" @http="tableWatch" :pagination="false" :expand="false" :control="false">
        <el-table-column
          v-if="dialogSearch.row.zt === 0"
          fixed="right"
          align="center"
          slot="operation"
          class-name="operationMore"
          label="操作"
          width="80">
          <template slot-scope="s">
            <el-button type="info" size="mini" icon="edit" @click="dialogSearchEditOpen(s.row)"></el-button>
          </template>
        </el-table-column>
      </s-table>
    </s-dialog>
    <s-dialog :dialog="dialogSearchEdit" :close="dialogSearchEditInit">
      <p slot="title">{{dialogSearchEdit.title}}补货单</p>
      <s-form :form="formDialogSearchEdit" ref="formDialogSearchEdit">
        <el-row>
          <el-col :xs="24" :lg="{span: 11, offset: 0}">
            <el-form-item prop="hpmc" label="货品名称">
              <el-input
                type="text"
                disabled
                v-model="formDialogSearchEdit.hpmc"
                placeholder="货品名称"></el-input>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :lg="{span: 11, offset: 1}">
            <el-form-item prop="bhsl" label="补货数量">
              <el-input
                type="text"
                v-model="formDialogSearchEdit.bhsl"
                placeholder="补货数量"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
      </s-form>
      <el-button slot="footer" type="success"  @click="dialogSearchEditSave">保存</el-button>
    </s-dialog>
    <s-dialog :dialog="dialogIssued" :close="dialogIssuedInit">
      <p slot="title">{{dialogIssued.title}}补货任务</p>
      <s-form :form="formDialogIssued" ref="formDialogIssued">
        <el-row>
          <el-col :xs="24" :lg="{span: 11, offset: 0}" class="">
            <el-form-item prop="account" label="账户类型">
              <el-select v-model="formDialogIssued.account" placeholder="请选择">
                <el-option
                  v-for="item in SHELVESTASK.account"
                  :key="item.dictionaryid"
                  :label="item.value"
                  :value="item.dictionaryid">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :lg="{span: 11, offset: 1}" class="">
            <el-form-item prop="ryid" label="人员">
              <el-select v-model="formDialogIssued.ryid"
                         filterable
                         @change="dialogRemoteryid"
                         placeholder="请输入人员名称">
                <el-option
                  v-for="item in dialogIssued.wmsqualityinspectionlist"
                  :key="item.id"
                  :label="item.name"
                  :value="item.id">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
      </s-form>
      <el-button slot="footer" @click="dialogIssuedSave">保存</el-button>
    </s-dialog>
    <s-dialog :dialog="dialogReplenishment" :close="dialogReplenishmentInit">
      <s-table :table="tableReplenishment" ref="tableReplenishment" @http="tableWatch"></s-table>
    </s-dialog>
  </div>
</template>

<script>
  import {AutoVue, AutoPromise, GetLodop, FormatterTime} from '~/plugins/Tools';
  import Mapan from '~/components/zxwmsPrint/mapan.vue';
  import Vue from 'vue';

  function __form () {
    return {
      gzmc: { value: '', rule: [ 'vNull' ], cRemarks: '' },
      gzzd: { value: '', rule: [ 'vNull' ], cRemarks: '' },
      gzms: { value: '', cRemarks: '' },
    };
  }
  function __formSearchEdit () {
    return {
      hpmc: { value: '', rule: [ 'vNull' ], cRemarks: '' },
      bhsl: { value: '', rule: [ 'vNull' ], cRemarks: '' },
    };
  }
  function __formIssued () {
    return {
      account: { value: '', rule: [ 'vNull__change' ] },
      ryid: { value: '', rule: [ 'vNull__change' ] },
    };
  }
  export default AutoVue({
    name: 'stock_orderReplenishment-FEcarWms',
    head: {
      'title': '订单驱动补货管理',
      'meta': [
        { 'hid': 'description', 'name': 'description', 'content': '乐速科技平台 订单驱动补货 查看订单驱动补货信息' },
      ],
    },
    store: ['ORDERREPLENISHMENT', 'DICTIONARY_orderReplenishment', 'DICTIONARY_shelvesTask', 'SHELVESTASK'],
    data: {
      table: {
        column: [ { label: '补货编号',
          prop: 'bhbh',
          minWidth: '0px',
          cRemarks: '',
          search: false },
        { label: '创建时间',
          prop: 'cjsj',
          minWidth: '0px',
          type: 'DateRange',
          cRemarks: '',
          formatter: (row, column) => {
            return this.a.methods.formatterTime(row[column.property || column], 6);
          },
          search: true },
        { label: '确认时间',
          prop: 'qrsj',
          minWidth: '0px',
          cRemarks: '',
          formatter: (row, column) => {
            return this.a.methods.formatterTime(row[column.property || column], 6);
          },
          search: false },
        { label: '创建人员',
          prop: 'cjry',
          minWidth: '0px',
          cRemarks: '',
          search: false },
        { label: '补货单状态',
          prop: 'show_zt',
          minWidth: '0px',
          cRemarks: '0：已生成 1：已确认 2：作废',
          search: true },
        { label: '生成状态',
          prop: 'show_sczt',
          minWidth: '0px',
          cRemarks: '0：初始 1：已确认 2：作废',
          search: true },
        { label: '确认人员',
          prop: 'qrry',
          minWidth: '0px',
          cRemarks: '',
          search: false } ],
        url: '/wmsorderrepair/list',
        key: 'id',
        tableColumn: 6,
      },
      formDialog: __form(),
      dialog: {
        title: '生成',
        row: {},
        size: 'large',
        message: {},
      },
      tableAdd: {
        column: [
          { label: '创建时间',
            prop: 'cjsj',
            minWidth: '0px',
            type: 'DateRange',
            cRemarks: '',
            formatter: (row, column) => {
              return this.a.methods.formatterTime(row[column.property || column], 6);
            },
            search: false },
          { label: 'SO编号',
            prop: 'fybh',
            minWidth: '0px',
            cRemarks: '',
            search: true },
          { label: '客户名称',
            prop: 'khmc',
            minWidth: '0px',
            cRemarks: '',
            search: true },
          { label: '联系人',
            prop: 'lxrxm',
            minWidth: '0px',
            cRemarks: '',
            search: true },
          { label: '电话',
            prop: 'lxrdh',
            minWidth: '0px',
            cRemarks: '',
            search: false },
          { label: '地址',
            prop: 'khdz',
            minWidth: '0px',
            cRemarks: '',
            search: true },
          { label: '单据类型',
            prop: 'show_lx',
            minWidth: '0px',
            cRemarks: '',
            search: false },
          { label: '品项数',
            prop: 'pxs',
            minWidth: '0px',
            cRemarks: '',
            search: false },
          { label: '总数量',
            prop: 'zsl',
            minWidth: '0px',
            cRemarks: '',
            search: false },
          { label: '计划发货时间',
            prop: 'jhfhsj',
            minWidth: '0px',
            type: 'DateRange',
            cRemarks: '',
            formatter: (row, column) => {
              return this.a.methods.formatterTime(row[column.property || column], 6);
            },
            search: false },
          { label: '要求交货时间',
            prop: 'yqjhsj',
            minWidth: '0px',
            type: 'DateRange',
            cRemarks: '',
            formatter: (row, column) => {
              return this.a.methods.formatterTime(row[column.property || column], 6);
            },
            search: false },
          { label: '发货状态',
            prop: 'show_fyzt',
            minWidth: '0px',
            cRemarks: '',
            search: false },
          { label: '备注',
            prop: 'bz',
            minWidth: '0px',
            cRemarks: '',
            search: false },
          { label: '波次编号',
            prop: 'bcbh',
            minWidth: '0px',
            cRemarks: '',
            search: true },
        ],
        url: '/wmsshipmentorder/getShipmentOrder',
        key: 'id',
        tableColumn: 5,
      },
      dialogSearch: {
        title: '查看',
        row: {},
      },
      tableSearch: {
        column: [
          { label: '货品名称',
            prop: 'hpmc',
            minWidth: '0px',
            cRemarks: '',
            search: false },
          { label: '补货数量',
            prop: 'bhsl',
            minWidth: '0px',
            cRemarks: '',
            search: false },
        ],
        key: 'id',
        url: ' /wmsorderrepair/getDetailList',
        tableColumn: 2,

      },
      dialogSearchEdit: {
        title: '编辑',
        row: {},
      },
      formDialogSearchEdit: __formSearchEdit(),
      dialogIssued: {
        title: '下发',
        wmsqualityinspectionlist0: '',
        wmsqualityinspectionlist1: '',
        wmsqualityinspectionlist: '',
        row: {},
        ryid: '',
      },
      formDialogIssued: __formIssued(),
      dialogReplenishment: {
        title: '查看',
        size: 'large',
      },
      tableReplenishment: {
        column: [
          { label: '货品编号',
            prop: 'hpbh',
            minWidth: '0px',
            cRemarks: '',
            search: false },
          { label: '货品名称',
            prop: 'hpmc',
            minWidth: '0px',
            cRemarks: '',
            search: false },
          { label: '包装数量',
            prop: 'zdwsl',
            minWidth: '0px',
            cRemarks: '',
            search: false },
          { label: '包装描述',
            prop: 'ms',
            minWidth: '0px',
            cRemarks: '',
            search: false },
          { label: '补货出库位',
            prop: 'bhckw',
            minWidth: '0px',
            cRemarks: '',
            search: false },
          { label: '补货数量',
            prop: 'bhsl',
            minWidth: '0px',
            cRemarks: '',
            search: false },
          { label: '托盘码',
            prop: 'lpn',
            minWidth: '0px',
            cRemarks: '',
            search: false },
        ],
        option: {
          bhlx: '',
          bhid: '',
        },
        url: '/wmspdareplenishment/list',
        tableColumn: 7,

      },
    },
    transition: 'slide-fade',
    methods: {
      tablePrint (row) {
        let tableRef = 'table';

        let ids = [];
        if (row) {
          ids.push(row.id);
        } else {
          if (this[tableRef].multipleSelection.length < 1) {
            return this.$alert('您还未选择，请您至少选择一个！', '提示');
          }
          this[tableRef].multipleSelection.forEach(item => {
            ids.push(item.id);
          });
        }
        this.$confirm('您将打印补货信息。', '确认打印？', {
          confirmButtonText: '是',
          cancelButtonText: '否',
          type: 'warning',
        }).then(async () => {
          let LODOP = GetLodop();
          LODOP.PRINT_INIT('打印补货信息');
          let {contentList, totals} = await this.post('/wmsorderrepair/print', {ids});
          let time = this.formatterTime(new Date(), 6);
          let index = 1;
          for (let item of contentList) {
            let print = new Vue({
              el: document.createElement('div'),
              render (h) {
                return h(
                  'print', {
                    props: {
                      dialogPrint: this.dialogPrint,
                    },
                  }
                );
              },
              data: {
                dialogPrint: {
                  data: {
                    ...item,
                    scrq: FormatterTime(new Date(item.scrq)),
                    time,
                    index,
                    totals,
                  },
                },
              },
              components: {
                'print': Mapan,
              },
            });
            index++;
            let HTML = `<html>
${header()}
<body>
${print.$el.innerHTML}
</body>
</html>`;
            LODOP.NewPage();
            LODOP.ADD_PRINT_HTM(0, 0, '100mm', '80mm', HTML);
            LODOP.ADD_PRINT_BARCODE('11.38mm', '5.82mm', '52.92mm', '11.91mm', '128A', item.asnbh);
            LODOP.ADD_PRINT_BARCODE('52.12mm', '47.36mm', '45mm', '11.91mm', '128A', item.lpn);
          }
          LODOP.PREVIEW();
          // LODOP.PRINT_DESIGN();
        });
      },
      tableExport (row) {
        let tableRef = 'table';

        let ids = [];
        if (row) {
          ids.push(row.id);
        } else {
          this[tableRef].multipleSelection.forEach(item => {
            ids.push(item.id);
          });
        }
        this.$confirm('您将导出订单驱动补货。', '确认导出？', {
          confirmButtonText: '是',
          cancelButtonText: '否',
          type: 'warning',
        })
          .then(async _ => {
            try {
              let option = Object.assign({}, this['autoVue_' + tableRef]);
              await this.p({
                url: '/wmsorderrepair/getOutPutList',
                method: 'post',
                responseType: 'blob',
                data: {
                  ids,
                  ...option,
                },
              });
            } catch (err) {
              console.log(err);
            }
          })
          .catch(_ => {
          });
      },
      tableConfirm (row) {
        let ids = [];
        if (row) {
          ids.push(row.id);
        } else {
          if (this.table.multipleSelection.length < 1) {
            return this.$alert('您还未选择，请您至少选择一个！', '提示');
          }
          this.table.multipleSelection.forEach(item => {
            ids.push(item.id);
          });
        }
        this.$confirm('您将进行确认补货的操作', '确认补货？', {
          confirmButtonText: '是',
          cancelButtonText: '否',
          type: 'warning',
        })
          .then(async _ => {
            try {
              await this.post('/wmsorderrepair/confirmOrder', {
                ids,
              });
              this.tableWatch('table');
            } catch (err) {
              console.log(err);
            }
          })
          .catch(_ => {
          });
      },
      tableDelete (row) {
        let ids = [];
        if (row) {
          ids.push(row.id);
        } else {
          if (this.table.multipleSelection.length < 1) {
            return this.$alert('您还未选择，请您至少选择一个！', '提示');
          }
          this.table.multipleSelection.forEach(item => {
            ids.push(item.id);
          });
        }
        this.$confirm('您将删除选择的数据', '确认删除？', {
          confirmButtonText: '是',
          cancelButtonText: '否',
          type: 'warning',
        })
          .then(async _ => {
            try {
              await this.post('/wmsorderrepair/delete', {
                ids,
              });
              this.tableWatch('table');
            } catch (err) {
              console.log(err);
            }
          })
          .catch(_ => {
          });
      },
      dialogInit () {
        this.tableClear('tableAdd');
      },
      dialogOpen () {
        if (this.table.data.length > 0) {
          let bool = true;
          let ids = [];
          this.table.data.forEach(async item => {
            ids.push(item.zt);
            if (this.table.data.length > 0 && item.zt === 0) {
              this.$alert('请把补货单据生成确认后才可以新增下一条补货单据', '提示');
              bool = false;
            } else {
              if (bool) {
                this.tableAdd.url = '/wmsshipmentorder/getShipmentOrder';
                this.tableWatch('tableAdd');
                this.dialog.visible = true;
              }
            }
          });
        } else {
          this.tableAdd.url = '/wmsshipmentorder/getShipmentOrder';
          this.tableWatch('tableAdd');
          this.dialog.visible = true;
        }
        // this.tableAdd.url = '/wmsshipmentorder/getShipmentOrder';
        // this.tableWatch('tableAdd');
        // this.dialog.visible = true;
      },
      async dialogSave () {
        let ids = [];
        if (this.tableAdd.multipleSelection.length < 1) {
          this.$alert('请至少选择1个补货', '提示');
        } else {
          this.tableAdd.multipleSelection.forEach(item => {
            ids.push(item.id);
          });
          try {
            await this.post('/wmsorderrepair/add', {
              ids,
            });
            this.tableWatch('table');
            this.dialogInit();
            this.dialog.visible = false;
          } catch (err) {
            console.log(err);
          }
        }
      },

      dialogSearchInit () {},
      async dialogSearchOpen (row) {
        try {
          this.tableSearch.data = await this.post('/wmsorderrepair/getDetailList', {
            id: row.id,
          });
          this.dialogSearch.row.id = row.id;
          this.tableSearch.visible = true;
        } catch (err) { console.log(err); }
        this.dialogSearch.row = row;
        this.dialogSearch.visible = true;
      },
      dialogSearchEditInit () {
        this.formDialogSearchEdit = {
          ...this.formDialogSearchEdit,
          ...this.ObjectClone(__formSearchEdit()),
        };
      },
      dialogSearchEditOpen (row) {
        this.formDialogSearchEdit = {
          ...this.formDialogSearchEdit,
          ...this.ObjectClone(__formSearchEdit(), row),
        };
        this.dialogSearchEdit.row = row;
        this.dialogSearchEdit.visible = true;
      },
      dialogSearchEditSave () {
        this.VALIDATE('formDialogSearchEdit', async option => {
          try {
            delete option.hpmc;
            option.id = this.dialogSearchEdit.row.id;
            await this.post('/wmsorderrepairdetailed/edit', option);
            try {
              this.tableSearch.data = await this.post('/wmsorderrepair/getDetailList', {
                id: this.dialogSearch.row.id,
              });
              this.tableSearch.visible = true;
            } catch (err) { console.log(err); }
            this.dialogSearchEditInit();
            this.dialogSearchEdit.visible = false;
          } catch (err) {
            console.log(err);
          }
        });
      },
      dialogIssuedInit () {
        this.formDialogIssued = {
          ...this.formDialogIssued,
          ...this.ObjectClone(__formIssued()),
        };
        this.resetFields('formDialogIssued');
      },
      async dialogIssuedOpen (row) {
        await AutoPromise([
          async () => {
            if (!this.DICTIONARY_shelvesTask) {
              await this.USE('DICTIONARY_shelvesTask');
            }
          },
        ]);
        this.dialogIssued.row = row;
        console.log('id:' + this.dialogIssued.row.id);
        this.dialogIssued.visible = true;
      },
      async dialogRemoteryid1 (id) {
        this.dialogIssued.wmsqualityinspectionlist1.forEach(value => {
          this.dialogIssued.row.dlyhid1 = value.dlyhid;
          this.dialogIssued.row.dlyhmc1 = value.dlyhmc;
        });
      },
      async dialogRemoteryid (id) {
        this.dialogIssued.wmsqualityinspectionlist.forEach(value => {
          if (id === value.id) {
            this.dialogIssued.row.userName = value.name;
          }
        });
      },
      dialogIssuedSave () {
        if (this.formDialogIssued.account === '0') {
          this.VALIDATE('formDialogIssued', async option => {
            delete option.account;
            option.userId = '' + option.ryid;
            delete option.ryid;
            option.userName = this.dialogIssued.row.userName;
            option.id = this.dialogIssued.row.id;
            try {
              await this.post('/wmsorderrepair/addBhRw', option);
              this.dialogIssuedInit();
              this.tableWatch('table');
              this.dialogIssued.visible = false;
            } catch (err) {
              console.log(err);
            }
          });
        } else {
          this.VALIDATE('formDialogIssued', async option => {
            delete option.account;
            option.userId = '' + option.ryid;
            delete option.ryid;
            option.userName = this.dialogIssued.row.userName;
            option.id = this.dialogIssued.row.id;
            try {
              await this.post('/wmsorderrepair/addBhRw', option);
              this.dialogIssuedInit();
              this.tableWatch('table');
              this.dialogIssued.visible = false;
            } catch (err) {
              console.log(err);
            }
          });
        }
      },
      dialogReplenishmentInit () {},
      dialogReplenishmentOpen (row) {
        this.tableReplenishment.url = '/wmspdareplenishment/list';
        this.tableReplenishment.option.bhlx = '0';
        this.tableReplenishment.option.bhid = row.id;
        this.tableWatch('tableReplenishment');
        this.dialogReplenishment.visible = true;
      },
    },
    watch: {
      'formDialogIssued.account': async function (account) {
        this.formDialogIssued.ryid = '';
        if (account.length !== 0 && account === '0') {
          this.dialogIssued.wmsqualityinspectionlist = await this.post('/wmsqualityinspectionlist/selectYh', {});
        }
        if (account.length !== 0 && account === '1') {
          let {contentList} = await this.post('/wmsqualityinspectionlist/selectPDADLByHz', {
          });
          this.dialogIssued.wmsqualityinspectionlist = contentList;
        }
      },
    },
    mounted: async function () {
      this.tableWatch('table');
      if (!this.DICTIONARY_orderReplenishment) {
        await this.USE('DICTIONARY_orderReplenishment');
      }
    },
  });
  function header () {
    return `
<head>
<style>
/* reset */
html {
  overflow: hidden;
}

body, div, dl, dt, dd, ul, ol, li, pre, code, form, fieldset, legend, textarea, blockquote, th, td, input, select, textarea, button {
  margin: 0;
  padding: 0
}

/* 重置fieldset（表单分组）、图片的边框为0*/
dl, ul, ol, menu, li {
  list-style: none
}

/* 重置类表前导符号为onne,menu在HTML5中有效 */
blockquote, q {
  quotes: none
}

/* 重置嵌套引用的引号类型 */
blockquote:before, blockquote:after, q:before, q:after {
  content: '';
  content: none
}

/* 重置嵌套引用*/
input, select, textarea, button {
  vertical-align: middle
}

/* 重置表单控件垂直居中*/
button {
  border: 0 none;
  background-color: transparent;
  cursor: pointer
}

/* 重置表单button按钮效果 */
body {
  background: #fff
}

/* 重置body 页面背景为白色 */
body, th, td, input, select, textarea, button {
}

/*清除浮动--推荐使用*/
.clearfix:before, .clearfix:after {
  content: '';
  display: table;
}
.el-form-item:before, .el-form-item:after {
  content: '';
  display: table;
}

.el-form-item:after {
  clear: both;
}
.clearfix:after {
  clear: both;
}

.el-card {
    border: 1px solid #d1dbe5;
    border-radius: 4px;
    background-color: #fff;
    overflow: hidden;
    box-shadow: 0 2px 4px 0 rgba(0,0,0,.12), 0 0 6px 0 rgba(0,0,0,.04);
}

.el-card__header {
    padding: 18px 20px;
    border-bottom: 1px solid #d1dbe5;
    box-sizing: border-box;
}

.el-card__body {
    padding: 20px;
}

.el-row {
    position: relative;
    box-sizing: border-box;
}

.el-progress-bar__inner:after, .el-row:after, .el-row:before, .el-slider:after, .el-slider:before, .el-slider__button-wrapper:after, .el-upload-cover:after {
    content: "";
}

.el-row:after, .el-row:before {
    display: table;
}

  .mapanPrint .el-card__body{
    padding: 0 20px 20px;
  }
  .mapanPrint .title span{
    float: right;
  }
  .mapanbh{
    float: left;
    width: 50%;
  }
  .asnbh{
    height: 45px;
  }
  .mapanPrint .el-form-item{
    margin-bottom: 10px;
  }
.el-form-item__label {
    text-align: right;
    vertical-align: middle;
    float: left;
    font-size: 14px;
    color: #48576a;
    line-height: 1;
    padding: 11px 12px 11px 0;
    box-sizing: border-box;
}


.el-form-item__content {
    line-height: 36px;
    position: relative;
    font-size: 14px;
    float: left;
}
.s-content{
  display:inline-block;
}
.title{
    float: left;
    width: 50%;
  }
.title .right{
    float: right;
  }
html{width:378px;height:302px;overflow:hidden;}
</style>
</head>
    `;
  }
</script>
<style scoped lang="scss">
  .box-card {
    margin: 20px;
  }

  .createTimeSpan {
    display: block;
    margin-top: 34px;
  }

  @media screen and (max-width: 800px) {
    .createTimeSpan {
      margin-top: 0;
    }
    .box-card {
      margin: 0;
    }
  }

  .el-select {
    width: 100%;
  }
</style>

<style lang="scss">

</style>
